#!/usr/bin/env python
PACKAGE = "pcl_segmentation"

from dynamic_reconfigure.parameter_generator_catkin import *

gen = ParameterGenerator()

gen.add("x_min", double_t, 0, "unit: cm, distance range min", -5, -5, 0)
gen.add("x_max", double_t, 0, "unit: cm, distance range max", 5, 0, 5)
gen.add("y_min", double_t, 0, "unit: cm, distance range min", -5, -5, 0)
gen.add("y_max", double_t, 0, "unit: cm, distance range max", 5, 0, 5)
gen.add("z_min", double_t, 0, "unit: cm, distance range min", -5, -5, 0)
gen.add("z_max", double_t, 0, "unit: cm, distance range max", 5, 0, 5)

NormalEstimationMethod = gen.enum([gen.const("COVARIANCE_MATRIX", int_t, 0, "COVARIANCE_MATRIX"),
                                   gen.const("AVERAGE_3D_GRADIENT", int_t, 1, "AVERAGE_3D_GRADIENT"),
                                   gen.const("AVERAGE_DEPTH_CHANGE", int_t, 2, "AVERAGE_DEPTH_CHANGE"),
                                   gen.const("SIMPLE_3D_GRADIENT", int_t, 3, "SIMPLE_3D_GRADIENT")],
                                  "NormalEstimationMethod")

gen.add("normalEstimationMethod", int_t, 0, "Select NormalEstimationMethod", 0, 0, 4,
        edit_method=NormalEstimationMethod)

gen.add("depth_change_factor", double_t, 0, " ", 0.02, 0, 0.5)
gen.add("normal_smoothing_size", double_t, 0, " ", 5, 0, 20)

gen.add("voxel_x", double_t, 0, " ", 0.01, 0, 0.1)
gen.add("voxel_y", double_t, 0, " ", 0.01, 0, 0.1)
gen.add("voxel_z", double_t, 0, " ", 0.01, 0, 0.1)

gen.add("parallel_angle_diff", double_t, 0, " ", 19, 0, 90)
gen.add("perpendicular_angle_diff", double_t, 0, " ", 24, 0, 90)

gen.add("noleg_distance", double_t, 0, " ", 0.6, 0, 2)

gen.add("seg_threshold", double_t, 0, " ", 0.01, 0, 0.5)
gen.add("seg_plane_angle_diff", double_t, 0, " ", 7, 0, 45)

gen.add("seg_rest_point", int_t, 0, " ", 235, 0, 800)
gen.add("seg_max_iters", int_t, 0, " ", 100, 10, 500)

gen.add("cluster_tolerance", double_t, 0, " ", 0.03, 0, 0.2)
gen.add("min_cluster_size", int_t, 0, " ", 9, 0, 200)

exit(gen.generate(PACKAGE, "pclseg_param_node", "pclseg_param"))
